home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-03-04 | 1.8 KB | 101 lines | [TEXT/ToyS] |
- -- Preferences
- property kasPrefName : "Make Visible 1.0"
-
- -- Globals
- global gasInfoWind -- Info window
- global gasInfoPos -- Position of info window
- global gasDid -- Number gone!
- global gasChecked -- Number checked!
-
-
- on open fsObjs
- -- Load prefs, show window
- pfLoad()
-
- set gasDid to 0
- set gasChecked to 0
-
- set gasInfoWind to display info titled kasPrefName ¬
- located at gasInfoPos ¬
- message "Scanning…"
-
- -- Do files
- repeat with fsObj in fsObjs
- set myInfo to (extended info for fsObj)
-
- if (invisible status of myInfo) then
- DoOne(fsObj)
- end if
- end repeat
-
- display info gasInfoWind message "DONE!"
-
- pause for 5 with seconds timing -- Let screen wait...
-
- set gasInfoPos to screen location of ¬
- (display info gasInfoWind with disposal)
-
- pfSave() -- Save window location
- end open
-
-
- on DoOne(fsObj)
- set aFileInfo to (alias info from fsObj)
-
- display info gasInfoWind ¬
- message "File: " & (original name of aFileInfo) ¬
- at line 2
-
- set gasChecked to gasChecked + 1
-
- try
- set myInfo to (extended info for fsObj)
- on error
- beep
- return
- end try
-
- set invisible status of myInfo to false
-
- try
- set the catalog info of fsObj to myInfo
- set gasDid to gasDid + 1
- display info gasInfoWind ¬
- message ("Did: " & gasDid) ¬
- at line 6 ¬
- using color 15 * 32
- on error
- beep
- end try
-
- set myInfo to (extended info for fsObj)
-
- if (invisible status of myInfo) then
- display info gasInfoWind ¬
- message ("Couldn't change status") ¬
- at line 5 ¬
- using color 15 * 32 * 32
- beep
- end if
-
- display info gasInfoWind ¬
- message ("Checked: " & gasChecked) ¬
- at line 7 ¬
- using color 15
- end DoOne
-
-
- on pfLoad()
- try
- set ourPrefs to (load preference named kasPrefName)
- set gasInfoPos to item 1 of ourPrefs
- on error
- set gasInfoPos to {0, 0}
- end try
- end pfLoad
-
-
- on pfSave()
- save preference {gasInfoPos} named kasPrefName
- end pfSave
-